/**
 * 
 */
package org.statewalker.tokenizer.base;

/**
 * @author kotelnikov
 */
public final class SequenceTokenizer<T>
    extends
    SimpleTokenizer<T> {

    private String fSequence;

    public SequenceTokenizer(ITokenFactory<T> factory, String sequence) {
        super(factory);
        fSequence = sequence;
    }

    /**
     * @see org.statewalker.tokenizer.base.SimpleTokenizer#checkChar(char,
     *      int)
     */
    @Override
    protected boolean checkChar(char ch, int pos) {
        char c = fSequence.charAt(pos);
        return ch == c;
    }

    @Override
    protected int getMaxLength() {
        return fSequence.length();
    }

    @Override
    protected int getMinLength() {
        return fSequence.length();
    }

}
